package com.controller;

import com.model.DanmakuShield;
import com.model.HotBarrage;
import com.model.HotList;
import com.response.Result;
import com.server.HotBarrageService;
import com.server.HotListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("热门榜单内视频信息")
@RestController
@RequestMapping("/hotList")
public class HotListController {

    @Autowired
    private HotListService hotListService;

    @CrossOrigin
    @RequestMapping(value = "/addHotList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public int insertHotList(@RequestBody HotList hotList){
        System.out.println("进入热门榜视频添加方法");
        return hotListService.insertHotList(hotList);
    }

    @CrossOrigin
    @RequestMapping(value = "/getAllHotList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<HotList> getAllHotList(@RequestBody HotList hotList){
        System.out.println("进入弹幕分析结果查询方法");
        return hotListService.getAllHotList(hotList);
    }

    @CrossOrigin
    @RequestMapping(value = "/getAllAllList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<HotList> getAllAllList(@RequestBody HotList hotList){
        System.out.println("进入'全站'结果查询方法");
        return hotListService.getAllAllList(hotList);
    }

    @CrossOrigin
    @RequestMapping(value = "/getAllDanceList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<HotList> getAllDanceList(@RequestBody HotList hotList){
        System.out.println("进入'舞蹈'结果查询方法");
        return hotListService.getAllDanceList(hotList);
    }

    @CrossOrigin
    @RequestMapping(value = "/getAllGameList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<HotList> getAllGameList(@RequestBody HotList hotList){
        System.out.println("进入'游戏'结果查询方法");
        return hotListService.getAllGameList(hotList);
    }

    @CrossOrigin
    @RequestMapping(value = "/getAllDougaList", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<HotList> getAllDougaList(@RequestBody HotList hotList){
        System.out.println("进入'动画'结果查询方法");
        return hotListService.getAllDougaList(hotList);
    }

    @ApiOperation(value = "热门榜单")
    @GetMapping("/seletHotList")
    @CrossOrigin
    public Result<Object> seletHotList(){
        return hotListService.seletHotList();
    }


    @ApiOperation(value = "全部信息")
    @GetMapping("/seletBVId")
    @CrossOrigin
    public Result<Object> seletBVId(@RequestParam String Bvid){
        return hotListService.seletBVId(Bvid);
    }
}
